<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: hlzhang
  Date: 2018/4/25
  Time: 8:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>宠物查询结果页面</title>
    <link href="css/styles.css" rel="stylesheet"/>
    <SCRIPT type="text/javascript">
        function confirmDialog()
        {
            if(confirm("确定要删除该宠物信息吗?"))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    </SCRIPT>
</head>
<body>
<div>
    <div id="header"><%@include file="/inc/header.inc" %></div>
    <div id="main">
        <table>
            <tr>
                <td align="center">宠物姓名</td>
                <td align="center">宠物生日</td>
                <td align="center">宠物照片</td>
                <td align="center">宠物主人</td>
            </tr>
            <c:forEach items="${cs}" var="c">
            <tr class="result">
                <td>${c.name}</td>
                <td>${c.birthdate}</td>
                <td><img src="..${c.photo}" width="50px" height="50px"></td>
                <td>${c.owner.name}</td>
                <td><form action="/doDelPet" method="post"><input type="hidden" value="${c.id}" name="id">
                    <input type="submit" value="删除" onclick=" return confirmDialog();"></form></td>
                <td><a href="PetServlet?m=modifyPet">修改</a></td>
            </tr>
            </c:forEach>
            <tr>
                <td></td>
                <td><input value="返回" type="button" onclick="location.href='petSearch.jsp'" /></td>
            </tr>
        </table>

        <h4 align="center" style="color:red"><%=request.getAttribute("msg") == null ? "" : request.getAttribute("msg")%></h4>
    </div>
    <div id="footer">
        <%@ include  file="inc/footer.inc"%>
    </div>
</div>
</body>
</html>
